package cn.lingyangwl.agile.pay.pay.controller.trade;

import cn.lingyangwl.agile.pay.common.annotation.PayCheck;
import cn.lingyangwl.agile.pay.common.service.TradeDataService;
import cn.lingyangwl.framework.core.response.Resp;
import cn.lingyangwl.agile.pay.model.rqrs.pay.payorder.TradeDataQO;
import cn.lingyangwl.agile.pay.model.rqrs.pay.payorder.TradeDataRS;
import cn.lingyangwl.agile.pay.validation.PaySignGroup;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author shenguangyang
 */
@RestController
@RequestMapping("/pay/trade")
public class TradeDataController {
    @Resource
    private TradeDataService tradeDataService;

    /**
     * 获取交易的数据
     */
    @GetMapping("/getTradeData")
    @PayCheck
    public Resp<TradeDataRS> getTradeData(@Validated(value = PaySignGroup.class) TradeDataQO req) {
        TradeDataRS resp = tradeDataService.getTradeData(req);
        return Resp.ok(resp);
    }
}
